#ifndef POOL_SURPPORT_H
#define POOL_SURPPORT_H

#include <boost/pool/object_pool.hpp>

template<typename T>
class PoolSurpport
{
public:
	static boost::object_pool<T> pool_;
public:
	static T* create() { return pool_.construct(); }
	static void free(T*& p) { pool_.destroy(p); p = NULL; }
};


#define PoolSurpportImp(Cls) \
template<> \
boost::object_pool<Cls> PoolSurpport<Cls>::pool_(sizeof(Cls));

#endif
